<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>修改商品</title>
    <th:block th:include="~{common/common::commonHead}"/>

</head>
<body data-width="850" data-height="500">
<form data-auto-set-value="edit" class="form-horizontal" data-get-url="goodsPublish/getGoodsPublishDetail" role="form" th:action="@{/goodsPublish/editGoodsPublishDetail}">
    <input type="hidden" id="goodsId" name="id">
    <input type="hidden" id="goodsImg" name="goodsImg">
    <div class="col-xs-4">
        <div id="localImg" style="margin-left: 45px;">
            <img id="preview" th:src="@{/img/type/defaultGoodsImg.png}" width="300" height="300" style="display: block; width: 300px; height: 300px; margin: auto">
        </div>
        <div class="iconic-input right">
            <!--<button type="button" class="btn btn-default" style="pointer-events: none; margin-left: 160px; margin-top: 3px;">-->
                <!--点击上传-->
            <!--</button>-->
            <input type="file" name="file" id="doc" style="width:78px;height: 32px; opacity: 0; position: relative; margin-top: -30px; margin-left: 160px;" onchange="setImagePreview();">
        </div>
    </div>
    <div class="col-xs-8">
        <div class="form-group">
            <label class="col-lg-2 col-md-2 col-sm-4 col-xs-4 control-label"> 商品名称 </label>
            <div class="col-lg-6 col-md-4 col-sm-8 col-xs-8">
                <div class="iconic-input right">
                    <input id="goodsName" name="goodsName"  type="text" class="form-control spinner" placeholder="1~20位字符" readonly required maxlength="20">
                </div>
            </div>
        </div>
    </div>
    <div class="col-xs-8">
        <div class="form-group">
            <label class="col-lg-2 col-md-2 col-sm-4 col-xs-4 control-label" readonly> 零售价 </label>
            <div class="col-lg-6 col-md-4 col-sm-8 col-xs-8">
                <div class="iconic-input right">
                    <input id="goodsMarketPrice" name="goodsMarketPrice" type="number" class="form-control spinner" placeholder="市场零售价格" readonly required data-valid-decimal="true" data-decimal="true" min="0.01" max="10000">
                </div>
            </div>
        </div>
    </div>
    <div class="col-xs-8">
        <div class="form-group">
            <label class="col-lg-2 col-md-2 col-sm-4 col-xs-4 control-label"> 供应价 </label>
            <div class="col-lg-6 col-md-4 col-sm-8 col-xs-8">
                <div class="iconic-input right">
                    <input id="goodsSellPrice" name="goodsSellPrice" type="number" class="form-control spinner" placeholder="供应价格" required data-valid-decimal="true" data-decimal="true" min="0.01" max="10000">
                </div>
            </div>
        </div>
    </div>
    <div class="col-xs-8">
        <div class="form-group">
            <label class="col-lg-2 col-md-2 col-sm-4 col-xs-4 control-label"> 结算价 </label>
            <div class="col-lg-6 col-md-4 col-sm-8 col-xs-8">
                <div class="iconic-input right">
                    <input id="goodsSettlementPrice" name="goodsSettlementPrice" type="number" class="form-control spinner" placeholder="结算价格" required data-valid-decimal="true" data-decimal="true" min="0.01" max="10000">
                </div>
            </div>
        </div>
    </div>
    <div class="col-xs-8">
        <div class="form-group">
            <label class="col-lg-2 col-md-2 col-sm-4 col-xs-4 control-label"> 商品单位 </label>
            <div class="col-lg-6 col-md-4 col-sm-8 col-xs-8">
                <div class="iconic-input right">
                    <input id="goodsUnit" name="goodsUnit" type="text" class="form-control spinner" placeholder="1~5位字符" readonly required maxlength="5">
                </div>
            </div>
        </div>
    </div>
    <div class="col-xs-8">
        <div class="form-group">
            <label class="col-lg-2 col-md-2 col-sm-4 col-xs-4 control-label"> 规格 </label>
            <div class="col-lg-6 col-md-4 col-sm-8 col-xs-8">
                <div class="iconic-input right">
                    <input id="goodsSpec" name="goodsSpec" type="text" class="form-control spinner" placeholder="1~5位字符" readonly required maxlength="5">
                </div>
            </div>
        </div>
    </div>
    <div class="col-xs-8">
        <div class="form-group">
            <label class="col-lg-2 col-md-2 col-sm-4 col-xs-4 control-label"> 箱规 </label>
            <div class="col-lg-6 col-md-4 col-sm-8 col-xs-8">
                <div class="iconic-input right">
                    <input id="boxSpec" name="boxSpec" type="text" class="form-control spinner" placeholder="1~5位字符" readonly required maxlength="5">
                </div>
            </div>
        </div>
    </div>
    <div class="col-xs-8">
        <div class="form-group">
            <label class="col-lg-2 col-md-2 col-sm-4 col-xs-4 control-label"> 条码 </label>
            <div class="col-lg-6 col-md-4 col-sm-8 col-xs-8">
                <div class="iconic-input right">
                    <input id="goodsBarCode" name="goodsBarCode" type="text" class="form-control spinner" placeholder="1~5位字符" readonly required maxlength="5">
                </div>
            </div>
        </div>
    </div>
    <div class="col-xs-8">
        <div class="form-group">
            <label class="col-lg-2 col-md-2 col-sm-4 col-xs-4 control-label"> 商品类型 </label>
            <div class="col-lg-6 col-md-4 col-sm-8 col-xs-8">
                <div class="iconic-input right">
                    <select name="goodsType" class="form-control" data-url="goods/listGoodsType" data-value-field="id" data-text-field="typeName" readonly required></select>
                </div>
            </div>
        </div>
    </div>
</form>
</body>
</html>
<script>
    function afterAutoSetValue(data) {
        $("#preview").attr("src", data.goodsImg);
    }
</script>